package com.yc.bank.mapper;

import com.yc.bank.entity.Account;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * <p>
 * 银行-账号表-2000000000 Mapper 接口
 * </p>
 *
 * @author lyx
 * @since 2023-06-01
 */

@Repository
public interface AccountMapper extends BaseMapper<Account> {


    //存取款
    @Update("update bank_account set balance = balance+#{money} where id = #{id}")
    public void     updateBalance(@Param("id") String id, @Param("money") double money);

    @Select("select * from bank_account where id = #{id}")
    public Account selectByid(String id);


}
